import unittest
from ddt import ddt, data, unpack
from UIAutoTest.shop_test.page.LoginPage import LoginPage
from UIAutoTest.shop_test.page.ShopCarPage import ShopCarPage
from UIAutoTest.shop_test.pom.BasePage import BasePage
from selenium import webdriver


class TestShop(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        cls.driver = webdriver.Chrome()
        cls.driver.maximize_window()
        cls.driver.implicitly_wait(10)

    @classmethod
    def tearDownClass(cls):
        cls.driver.quit()

    def test_Login(self):
        lp = LoginPage()
        lp.get_url('http://shop-xo.hctestedu.com/index.php?s=/index/user/logininfo.html')
        lp.doLogin('huace_tester', 'huace_tester')

    def test_shopcar(self):
        scp = ShopCarPage()
        scp.add_ShopCar()
